]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Do not duplicate "New Window" action
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Feb 2015 01:03:33 +0000 (02:03 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Feb 2015 22:27:44 +0000 (23:27 +0100)
We assume that applications that export a 'new-window' action can open
a new window, so we add an appropriate entry to the context menu.
However this duplicates functionality if the application already
exposes the action via the desktop file - don't add our own entry
in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=744446

js/ui/appDisplay.js

index 066c44af413fb1c26ae896a2924c8a8f757479f5..3549f9a9e77439cab88aa5e80d9752a760cf3d78 100644 (file)
@@ -1820,7 +1820,10 @@ const AppIconMenu = new Lang.Class({
         if (!this._source.app.is_window_backed()) {
             this._appendSeparator();
 
-            if (this._source.app.can_open_new_window()) {
+            let appInfo = this._source.app.get_app_info();
+            let actions = appInfo.list_actions();
+            if (this._source.app.can_open_new_window() &&
+                actions.indexOf('new-window') == -1) {
                 this._newWindowMenuItem = this._appendMenuItem(_("New Window"));
                 this._newWindowMenuItem.connect('activate', Lang.bind(this, function() {
                     if (this._source.app.state == Shell.AppState.STOPPED)
@@ -1832,8 +1835,6 @@ const AppIconMenu = new Lang.Class({
                 this._appendSeparator();
             }
 
-            let appInfo = this._source.app.get_app_info();
-            let actions = appInfo.list_actions();
             for (let i = 0; i < actions.length; i++) {
                 let action = actions[i];
                 let item = this._appendMenuItem(appInfo.get_action_name(action));